//
//  LeverTradeModel.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/7/23.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit

class LeverTradeModel: BaseModel {
    var buyPrice:Double = 0.00
    var sellPrice:Double = 0.00
    
    var regularModel:CoinRegularModel =  CoinRegularModel() //币种对应的规则
    
    var coinAssetModel:AssetModel = AssetModel() //杠杆账户资产
    
    //资产数组
    lazy var dateArr:Array<AssetModel> = {
        let array:Array<AssetModel> = []
        return array
    }()
    ///币种数组
    lazy var coninKidArray:Array<TradeCoinModel> = {
        let array:Array<TradeCoinModel> = []
        return array
    }()
    
    var coinPair: String  =  ""
    var isBuyBool:Bool = false
    
    func adapterInfo(viewModel:BaseViewModel) {
        if viewModel as? LeveragedTradeViewModel != nil {
            let data = viewModel as! LeveragedTradeViewModel
            buyPrice = data.buyPrice
            sellPrice = data.sellPrice
            regularModel = data.regularModel
            dateArr = data.dateArr
            coinPair = data.coinModel.name
            coninKidArray = data.coninKidArray
        }
    }
    
}
